home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FLOAT / FPNEG.ASM < prev    next >
Assembly Source File  |  1989-01-24  |  2KB  |  73 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAIMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Last Update 5 Oct 87   Version 2.0
  6. ;
  7. fpneg   ident   2,0
  8. ;
  9. ; MOTOROLA DSP56000/1 FPLIB - VERSION 2
  10. ;
  11. ; FPNEG - FLOATING POINT NEGATION SUBROUTINE
  12. ;
  13. ; Entry points: fneg_a  R = -A
  14. ;               fneg_x  R = -X
  15. ;
  16. ;       m = 24 bit mantissa (two's complement, normalized fraction)
  17. ;
  18. ;       e = 14 bit exponent (unsigned integer, biased by +8191)
  19. ;
  20. ; Input variables:
  21. ;
  22. ;   X   x1 = mx  (normalized)
  23. ;       x0 = ex
  24. ;
  25. ;   A   a2 = sign extension of ma
  26. ;       a1 = ma  (normalized)
  27. ;       a0 = zero
  28. ;
  29. ;       b2 = sign extension of ea (always zero)
  30. ;       b1 = ea
  31. ;       b0 = zero
  32. ;
  33. ; Output variables:
  34. ;
  35. ;   R   a2 = sign extension of mr
  36. ;       a1 = mr  (normalized)
  37. ;       a0 = zero
  38. ;
  39. ;       b2 = sign extension of er (always zero)
  40. ;       b1 = er
  41. ;       b0 = zero
  42. ;
  43. ; Error conditions:     Set CCR L=1 if floating point overflow.  Result
  44. ;                       is set to the maximum floating point value of the
  45. ;                       correct sign.  The CCR L bit remains set until
  46. ;                       cleared by the user.
  47. ;
  48. ;                       Set CCR L=1 if floating point underflow.  Result
  49. ;                       is set to floating point zero.  The CCR L bit
  50. ;                       remains set until cleared by the user.
  51. ;
  52. ; Assumes n0, m0, shift constant table and scaling modes
  53. ; initialized by previous call to the subroutine "fpinit".
  54. ;
  55. ; Alters Data ALU Registers
  56. ;       a2      a1      a0      a
  57. ;       b2      b1      b0      b
  58. ;       x1      x0      y1      y0
  59. ;
  60. ; Alters Address Registers
  61. ;       r0
  62. ;
  63. ; Alters Program Control Registers
  64. ;       pc      sr
  65. ;
  66. ; Uses 0 locations on System Stack
  67. ;
  68. ;
  69. fneg_x  tfr     x0,b    x1,a            ;get ex, mx
  70. fneg_a  neg     a       b,r0            ;negate ma, save ea
  71.         jmp     norm1                   ;normalize ma and check ea
  72.